﻿using System;
using System.Collections.Generic;
using System.Text;

using System.Collections;
using System.Data;
namespace DeThi1
{
    class clsAlbum
    {
        private string m_strMaAlbum;
        private string m_strTenAlbum;
        private string m_strMoTa;
        private string m_strNgayPhatHanh;        

        public string MAALBUM
        {
            get { return m_strMaAlbum; }
            set { m_strMaAlbum = value; }
        }
        public string TENALBUM
        {
            get { return m_strTenAlbum; }
            set { m_strTenAlbum = value; }
        }
        public string MOTA
        {
            get { return m_strMoTa; }
            set { m_strMoTa = value; }
        }
        public string NGAYPHATHANH
        {
            get { return m_strNgayPhatHanh; }
            set { m_strNgayPhatHanh = value; }
        }

        public clsAlbum()
        {
            m_strMaAlbum = "";
            m_strTenAlbum = "";
            m_strMoTa = "";
            m_strNgayPhatHanh = "";
        }
/////////////////////////////////////
        public clsAlbum(string maalbum, string tenalbum, string mota, string ngayphathanh)
        {
            m_strMaAlbum = maalbum;
            m_strTenAlbum = tenalbum;
            m_strMoTa = mota;
            m_strNgayPhatHanh = ngayphathanh;
        }
////////////////////////////////////////

        static public DataSet LayDanhSachAlbum(TruyXuatDuLieu txdl)
        {
            ArrayList MangAlbum = new ArrayList();
            string strSQL = "SELECT * FROM Album";
            DataSet dtSet = txdl.TruyVanDuLieu(strSQL, "Album");

            return dtSet;
        }
//////////////////////////////////////////////////

        public string ThemAlbum(TruyXuatDuLieu txdl)
        {
            string strThongBao = "";
            string strSQL = "INSERT INTO Album(TenAlbum,MoTa,NgayPhatHanh) VALUES('" + this.TENALBUM + "','" + this.MOTA + "','" + this.NGAYPHATHANH + "')";

            try
            {
                if (txdl.CapNhatDuLieu(strSQL) == true)
                {
                    strThongBao = "Thêm Album Thành Công!";
                }
            }
            catch (Exception)
            {
                strThongBao = "Thêm Album Thất Bại!!!";
            }
            return strThongBao;
        }
//////////////////////////////////////////////////////////////////
    }
}
